local m = require('utils.proxy')
local t = require('utils.table')
local helper = require('helper.textobjects')

return {
    "nvim-treesitter/nvim-treesitter",
	event = "BufReadPre",
    build = ":TSUpdate",
    config = function ()
        t.foreach(require("nvim-treesitter.parsers").get_parser_configs(),function(config)
            config.install_info.url = config.install_info.url:gsub("https://github.com/",m.get_proxy(''))
        end)
        local configs = require("nvim-treesitter.configs")

        configs.setup({
            ensure_installed = { "lua", "javascript", "vimdoc", "luadoc", "vim", "python", "css", "fish", "bash" },
            sync_install = false,
            highlight = {
                enable = true,
                additional_vim_regex_highlighting = false,
            },
            indent = {
                enable = true
            },
            incremental_selection = {
                enable = false
            },
            textobjects = helper.get_config()
        })
    end
}
-- EOP
